﻿CREATE TABLE [dbo].[BalconSetup] (
    [PrimaryKey]                      INT           CONSTRAINT [DF_BalconSetup_PrimaryKey] DEFAULT ((0)) NOT NULL,
    [CodUnitate]                      SMALLINT      CONSTRAINT [DF_BalconSetup_CodUnitate] DEFAULT ((0)) NOT NULL,
    [TipUnitate]                      NCHAR (2)     CONSTRAINT [DF_BalconSetup_TipUnitate] DEFAULT (N'C') NOT NULL,
    [FolosesteNota]                   BIT           CONSTRAINT [DF_BalconSetup_NumarNotaUtilizat] DEFAULT ((0)) NOT NULL,
    [FolosesteJurnal]                 BIT           CONSTRAINT [DF_BalconSetup_FolosesteJurnal] DEFAULT ((1)) NOT NULL,
    [FolosesteObservatii]             BIT           CONSTRAINT [DF_BalconSetup_FolosesteObservatii] DEFAULT ((1)) NOT NULL,
    [DocumentJustifRulaj]             BIT           CONSTRAINT [DF_BalconSetup_DocumentJustifRulaj] DEFAULT ((0)) NOT NULL,
    [IdSerieNC]                       NVARCHAR (20) NULL,
    [FolosesteValute]                 BIT           CONSTRAINT [DF_BalconSetup_FolosesteValute] DEFAULT ((0)) NOT NULL,
    [Linia1Stanga]                    VARCHAR (100) NULL,
    [Linia1Dreapta]                   VARCHAR (100) NULL,
    [Linia2Stanga]                    VARCHAR (100) NULL,
    [Linia2Dreapta]                   VARCHAR (100) NULL,
    [Linia3Stanga]                    VARCHAR (100) NULL,
    [Linia3Dreapta]                   VARCHAR (100) NULL,
    [AnCurent]                        SMALLINT      CONSTRAINT [DF_BalconSetup_AnCurent] DEFAULT ((2010)) NOT NULL,
    [LunaCurenta]                     SMALLINT      CONSTRAINT [DF_BalconSetup_LunaCurenta] DEFAULT ((1)) NOT NULL,
    [SoldPrecedentActiv]              BIT           CONSTRAINT [DF_BalconSetup_SoldPrecedentActiv] DEFAULT ((0)) NOT NULL,
    [CopiazaExplicatia]               BIT           CONSTRAINT [DF_BalconSetup_CopiazaExplicatia] DEFAULT ((1)) NOT NULL,
    [DataBlocareStart]                DATETIME      CONSTRAINT [DF_BalconSetup_DataBlocareStart] DEFAULT (getdate()) NOT NULL,
    [FaraAdaugareGrid]                BIT           CONSTRAINT [DF_BalconSetup_FaraAdaugareGrid] DEFAULT ((0)) NOT NULL,
    [SubsolStanga1]                   VARCHAR (100) NULL,
    [SubsolCentru1]                   VARCHAR (100) NULL,
    [SubsolDreapta1]                  VARCHAR (100) NULL,
    [SubsolStanga2]                   VARCHAR (100) NULL,
    [SubsolCentru2]                   VARCHAR (100) NULL,
    [SubsolDreapta2]                  VARCHAR (100) NULL,
    [SubsolNume3]                     VARCHAR (100) NULL,
    [SubsolSemnatura3]                VARCHAR (100) NULL,
    [NoteInchidereUnice]              BIT           CONSTRAINT [DF_BalconSetup_NoteInchidereUnice] DEFAULT ((1)) NOT NULL,
    [LiniiSemnatura]                  BIT           DEFAULT ((1)) NULL,
    [FolosesteSursaFinantare]         BIT           DEFAULT ((0)) NOT NULL,
    [SursaFinantareImplicita]         SMALLINT      NULL,
    [SolduriInitialeDefalcateJurnale] BIT           DEFAULT ((0)) NOT NULL,
    [FolosesteSectorBugetar]          BIT           DEFAULT ((0)) NOT NULL,
    [SectorBugetarImplicit]           SMALLINT      NULL,
    [NivelAfisareConturi]             SMALLINT      DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_BalconSetup] PRIMARY KEY CLUSTERED ([PrimaryKey] ASC, [CodUnitate] ASC),
    CONSTRAINT [FK_BalconSetup_SeriiNumerice] FOREIGN KEY ([IdSerieNC], [CodUnitate]) REFERENCES [dbo].[SeriiNumerice] ([IdSerie], [CodUnitate]),
    CONSTRAINT [FK_BalconSetup_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

